import { IsEmail, IsNotEmpty, IsString, MinLength } from 'class-validator'

export class RegisterDto {
  @IsString()
  @IsNotEmpty()
  username: string

  @IsEmail()
  email: string

  @IsString()
  @MinLength(6)
  password: string

  @IsString()
  phone?: string
}

export class LoginDto {
  @IsString()
  @IsNotEmpty()
  identifier: string // 可以是邮箱或手机号

  @IsString()
  @IsNotEmpty()
  password: string
}

export class ForgotPasswordDto {
  @IsEmail()
  email: string
}

export class ResetPasswordDto {
  @IsString()
  @IsNotEmpty()
  token: string

  @IsString()
  @MinLength(6)
  newPassword: string
}

export class UpdateProfileDto {
  @IsString()
  nickname?: string

  @IsString()
  avatar?: string

  @IsString()
  gender?: string

  @IsString()
  region?: string

  @IsString()
  signature?: string

  @IsString()
  interests?: string
}
